<?php $this->layout = 'futuretweet'; ?>
<html>
    <table>
    <h1><center>Future Timeline</center></h1>
        <div>
            <h2>
            <p>
                Editors :
            </p>
            </h2>
        <?php
        foreach ($e as $field): ?>                       
            <div style="background-color:#FFFFFF">
            <?php echo $this->Html->link($field['users']['username'], array('action' => 'viewScheduledTweet', $accID, $field['users']['userID'])); ?>
            </div>
        <?php endforeach; ?>
            <h2> 
        <p>
                J.Editors :
        </p>
            </h2>  
        <?php
        foreach ($je as $field): ?>
                  
            <div style="background-color:#FFFFFF">
            <?php echo $this->Html->link($field['users']['username'], array('action' => 'viewScheduledTweet1', $accID, $field['users']['userID'])); ?>
            </div>
        <?php endforeach; ?>
        <hr />
        </div>
        

        <?php foreach ($result as $field): ?>

            <tr style="background-color:#FFFFFF">
                
                <td><?php echo $field['User']['username'] . ': ' . $field['FutureTweet']['tweetText'] . ' ' . $field['FutureTweet']['release_date'];?></td>
                <td>
                    <?php 
                        if($field['FutureTweet']['approved'] == '0') {
                            echo $this->Html->link('Approve', array('action' => 'approveTweet', $field['FutureTweet']['id']));
                        } else {
                            echo $this->Html->link('Disprove', array('action' => 'approveTweet', $field['FutureTweet']['id']));
                        }
                    ?>
                    &nbsp;|&nbsp;
                    <?php echo $this->Html->link('Delete', array('action' => 'delete', $field['FutureTweet']['id']), array(), "Are you sure you want to delete this tweet ?");?>
                    &nbsp;|&nbsp;
                    <?php echo $this ->Html->link('Edit',array('action'=>'save1',  $field['FutureTweet']['id'])); ?>
                </td>
            </tr>

        <?php endforeach; ?>
            
      
            <h3>
            <p>Filter Tweets:
                <?php echo $this->Html->link('All', array('action' => 'viewAll' ));?>
                &nbsp;|&nbsp;
                <?php echo $this->Html->link('Approved', array('action' => 'viewApproved' ));?>
                &nbsp;|&nbsp;
                <?php echo $this->Html->link('Rejected', array('action' => 'viewRejected' ));?>
                &nbsp;|&nbsp;
                <?php echo $this->Html->link('Pending', array('action' => 'viewPending' ));?>
                
            </p>
            <hr />
            </h3>
            <h2>
            <p> Write Future tweet:
                <?php echo $this->Html->link('Post Tweet Now', array('action' => 'PostTweet')); ?>
                &nbsp;|&nbsp;
                <?php echo $this->Html->link('Post Tweet later', array('action' => 'PostTweetLater')); ?>
               
            </p>
            <hr />
            </h2>
            
            <h2>
                <p>
                     Notifications : <?php echo $num; ?>
                     
                </p>
            </h2>
        

    </table>

</html>